<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta name="generator" content="pdoc 0.9.1" />
<title>tronpytool.compile.basetest API documentation</title>
<meta name="description" content="" />
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/sanitize.min.css" integrity="sha256-PK9q560IAAa6WVRRh76LtCaI8pjTJ2z11v0miyNNjrs=" crossorigin>
<link rel="preload stylesheet" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/11.0.1/typography.min.css" integrity="sha256-7l/o7C8jubJiy74VsKTidCy1yBkRtiUGbVkYBylBqUg=" crossorigin>
<link rel="stylesheet preload" as="style" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/styles/github.min.css" crossorigin>
<style>:root{--highlight-color:#fe9}.flex{display:flex !important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:30px;overflow:hidden}#sidebar > *:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0 0 15px 0}#footer{font-size:.75em;padding:5px 30px;border-top:1px solid #ddd;text-align:right}#footer p{margin:0 0 0 1em;display:inline-block}#footer p:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:1em 0 .50em 0}h3{font-size:1.4em;margin:25px 0 10px 0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em 0}a{color:#058;text-decoration:none;transition:color .3s ease-in-out}a:hover{color:#e82}.title code{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900}pre code{background:#f8f8f8;font-size:.8em;line-height:1.4em}code{background:#f2f2f1;padding:1px 4px;overflow-wrap:break-word}h1 code{background:transparent}pre{background:#f8f8f8;border:0;border-top:1px solid #ccc;border-bottom:1px solid #ccc;margin:1em 0;padding:1ex}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-list div{display:flex}#http-server-module-list dt{min-width:10%}#http-server-module-list p{margin-top:0}.toc ul,#index{list-style-type:none;margin:0;padding:0}#index code{background:transparent}#index h3{border-bottom:1px solid #ddd}#index ul{padding:0}#index h4{margin-top:.6em;font-weight:bold}@media (min-width:200ex){#index .two-column{column-count:2}}@media (min-width:300ex){#index .two-column{column-count:3}}dl{margin-bottom:2em}dl dl:last-child{margin-bottom:4em}dd{margin:0 0 1em 3em}#header-classes + dl > dd{margin-bottom:3em}dd dd{margin-left:2em}dd p{margin:10px 0}.name{background:#eee;font-weight:bold;font-size:.85em;padding:5px 10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target .name{background:var(--highlight-color)}.name > span:first-child{white-space:nowrap}.name.class > span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5px solid #eee;padding-left:1em}.inheritance em{font-style:normal;font-weight:bold}.desc h2{font-weight:400;font-size:1.25em}.desc h3{font-size:1em}.desc dt code{background:inherit}.source summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.source summary > *{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.source pre{max-height:500px;overflow:auto;margin:0}.source pre code{font-size:12px;overflow:visible}.hlist{list-style:none}.hlist li{display:inline}.hlist li:after{content:',\2002'}.hlist li:last-child:after{content:none}.hlist .hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0 .5em}.admonition{padding:.1em .5em;margin-bottom:1em}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<style media="screen and (min-width: 700px)">@media screen and (min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em 4em;border-left:1px solid #ddd}pre code{font-size:1em}.item .name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toc ul ul,#index ul{padding-left:1.5em}.toc > ul > li{margin-top:.5em}}</style>
<style media="print">@media print{#sidebar h1{page-break-before:always}.source{display:none}}@media print{*{background:transparent !important;color:#000 !important;box-shadow:none !important;text-shadow:none !important}a[href]:after{content:" (" attr(href) ")";font-size:90%}a[href][title]:after{content:none}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}@page{margin:0.5cm}p,h2,h3{orphans:3;widows:3}h1,h2,h3,h4,h5,h6{page-break-after:avoid}}</style>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.1.1/highlight.min.js" integrity="sha256-Uv3H6lx7dJmRfRvH8TH6kJD1TSK1aFcwgx+mdg3epi8=" crossorigin></script>
<script>window.addEventListener('DOMContentLoaded', () => hljs.initHighlighting())</script>
</head>
<body>
<main>
<article id="content">
<header>
<h1 class="title">Module <code>tronpytool.compile.basetest</code></h1>
</header>
<section id="section-intro">
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python"># !/usr/bin/env python
# coding: utf-8
import codecs
import json
import os
import subprocess

import time

from tronpytool import Tron

ROOT = os.path.join(os.path.dirname(__file__))


class SolcWrap(object):
    &#34;&#34;&#34;docstring for SolcWrap&#34;&#34;&#34;
    OUTPUT_BUILD = &#34;build&#34;
    WORKSPACE_PATH = &#34;&#34;
    solfolder = &#34;&#34;
    file_name = &#34;xxx.sol&#34;
    prefixname = &#34;&#34;
    statement = &#39;End : {}, IO File {}&#39;

    def __init__(self, workspace):
        &#34;&#34;&#34;param workspace: this is the local path for the file set&#34;&#34;&#34;
        self.WORKSPACE_PATH = workspace
        super(SolcWrap, self).__init__()

    def SetOutput(self, path):
        self.OUTPUTBUILD = path
        return self

    def SetSolPath(self, path):
        self.solfolder = path
        return self

    def BuildRemote(self):
        &#34;&#34;&#34;This is the remote command to execute the solc_remote bash file
        using remote compile method to compile the sol files
        all works will be done with the remote server or using the docker&#34;&#34;&#34;
        list_files = subprocess.run([&#34;{}/solc_remote&#34;.format(self.WORKSPACE_PATH)])
        print(&#34;The exit code was: %d&#34; % list_files.returncode)
        return self

    def WrapModel(self):
        &#34;&#34;&#34;setup initialize the file for combined.json&#34;&#34;&#34;
        pathc = os.path.join(self.WORKSPACE_PATH, self.OUTPUT_BUILD, &#34;combined.json&#34;)
        try:
            pathcli = codecs.open(pathc, &#39;r&#39;, &#39;utf-8-sig&#39;)
            self.combined_data = json.load(pathcli)
        except Exception as e:
            print(&#34;Problems from loading items from the file: &#34;, e)
        return self

    def GetCodeClass(self, classname) -&gt; [any, any]:
        p1bin = os.path.join(self.WORKSPACE_PATH, self.OUTPUT_BUILD, &#34;{}.bin&#34;.format(classname))
        p2abi = os.path.join(self.WORKSPACE_PATH, self.OUTPUT_BUILD, &#34;{}.abi&#34;.format(classname))
        bin = codecs.open(p1bin, &#39;r&#39;, &#39;utf-8-sig&#39;).read()
        abi = json.load(codecs.open(p2abi, &#39;r&#39;, &#39;utf-8-sig&#39;))
        return abi, bin

    def byClassName(self, path, classname):
        return &#34;{prefix}:{name}&#34;.format(prefix=path, name=classname)

    def GetCodeTag(self, fullname):
        return self.combined_data[&#34;contracts&#34;][fullname][&#34;abi&#34;], self.combined_data[&#34;contracts&#34;][fullname][&#34;bin&#34;]

    def GetCode(self, path, classname) -&gt; [str, str]:
        abi = self.combined_data[&#34;contracts&#34;][self.byClassName(path, classname)][&#34;abi&#34;]
        bin = self.combined_data[&#34;contracts&#34;][self.byClassName(path, classname)][&#34;bin&#34;]
        return abi, bin

    def writeFile(self, content, filename):
        fo = open(filename, &#34;w&#34;)
        fo.write(content)
        fo.close()
        print(self.statement.format(time.ctime(), filename))

    @property
    def workspace(self):
        return self.WORKSPACE_PATH

    def StoreTxResult(self, tx_result_data, filepath):
        self.writeFile(json.dumps(tx_result_data, ensure_ascii=False), filepath)


class CoreDeploy:
    &#34;&#34;&#34;DEFI Contract deployment
    with the right strategies
    &#34;&#34;&#34;
    _contract_dict: dict
    FILE_CONTRACT = &#34;backedup&#34;
    ACTION_FOLDER = &#34;deploy_results&#34;
    COLLECTION_CONTRACTS = &#34;deployments&#34;

    def __init__(self, tron: Tron):
        self.tron = tron
        self._contract_dict = dict()

    @property
    def backupname(self) -&gt; str:
        &#34;&#34;&#34;preview the file name&#34;&#34;&#34;
        return self.FILE_CONTRACT

    @backupname.setter
    def backupname(self, filename: str) -&gt; None:
        &#34;&#34;&#34;the file name does not require extension name&#34;&#34;&#34;
        self.FILE_CONTRACT = filename

    @property
    def deployment_location(self) -&gt; str:
        return self.COLLECTION_CONTRACTS

    @deployment_location.setter
    def deployment_location(self, path: str) -&gt; None:
        self.COLLECTION_CONTRACTS = path

    def getAddr(self, keyname: str) -&gt; str:
        &#34;&#34;&#34;example: TT67rPNwgmpeimvHUMVzFfKsjL9GZ1wGw8&#34;&#34;&#34;
        return self._contract_dict.get(keyname)

    def getAddr0x(self, keyname: str) -&gt; str:
        &#34;&#34;&#34;example: 0xBBC8C05F1B09839E72DB044A6AA57E2A5D414A10&#34;&#34;&#34;
        return self.tron.address.to_hex_0x(self._contract_dict.get(keyname))

    def getAddr0x41(self, keyname: str) -&gt; str:
        &#34;&#34;&#34;example: 0x41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10&#34;&#34;&#34;
        return self.tron.address.to_hex_0x_41(self._contract_dict.get(keyname))

    def getAddrHex(self, keyname: str) -&gt; str:
        &#34;&#34;&#34;example: 41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10&#34;&#34;&#34;
        return self.tron.address.to_hex(self._contract_dict.get(keyname))

    def getAllAddress(self) -&gt; dict:
        return self._contract_dict

    def preview_all_addresses(self) -&gt; None:
        print(self._contract_dict)

    def deployedAddrsFilePath(self) -&gt; str:
        return os.path.join(self.sol_cont.workspace, self.ACTION_FOLDER,
                            &#34;{}.json&#34;.format(self.COLLECTION_CONTRACTS))

    def is_deployment(self) -&gt; bool:
        return self.is_deploy

    def connect_deploy_core(self, workspace: str, rebuild=False, deploy=False) -&gt; None:
        if rebuild:
            sol_contr = SolcWrap(workspace).BuildRemote()
        else:
            sol_contr = SolcWrap(workspace)

        self.is_deploy = deploy
        self.sol_cont = sol_contr
        if not deploy:
            &#34;&#34;&#34;try to load up the file from the existing path&#34;&#34;&#34;
            try:
                self._contract_dict = json.load(codecs.open(self.deployedAddrsFilePath(), &#39;r&#39;, &#39;utf-8-sig&#39;))
                print(&#34;==== 🛄 data is prepared and it is ready now.. &#34;)
                self.preview_all_addresses()
            except ValueError:
                pass
            except TypeError as e:
                print(e)

    def complete_deployment(self) -&gt; None:
        &#34;&#34;&#34;store up the deployed contrcat addresses to the local file storage&#34;&#34;&#34;
        self.sol_cont.StoreTxResult(self._contract_dict, self.deployedAddrsFilePath())

    def deploy(self, sol_wrap: SolcWrap, classname: str, params: list = []) -&gt; str:
        &#34;&#34;&#34;This is using the faster way to deploy files by using the specific abi and bin files&#34;&#34;&#34;
        _abi, _bytecode = sol_wrap.GetCodeClass(classname)
        contractwork = self.tron.trx.contract(abi=_abi, bytecode=_bytecode)
        contract = contractwork.constructor()
        tx_data = contract.transact(
            fee_limit=10 ** 9,
            call_value=0,
            parameters=params,
            consume_user_resource_percent=1)
        print(&#34;======== TX Result ✅&#34;)
        sign = self.tron.trx.sign(tx_data)
        print(&#34;======== Signing {} ✅&#34;.format(classname))
        result = self.tron.trx.broadcast(sign)
        path = &#34;{}/{}.json&#34;.format(self.ACTION_FOLDER, classname)
        print(&#34;======== Broadcast Result ✅ -&gt; {}&#34;.format(path))
        sol_wrap.StoreTxResult(result, path)
        contract_address = self.tron.address.from_hex(result[&#34;transaction&#34;][&#34;contract_address&#34;])
        self._contract_dict[classname] = contract_address
        print(&#34;======== address saved to ✅ {} -&gt; {}&#34;.format(contract_address, classname))
        return contract_address

    def classic_deploy(self, sol_wrap: SolcWrap, path: str, classname: str, params: list = []) -&gt; str:
        self.sol_cont.WrapModel()
        _abi, _bytecode = sol_wrap.GetCode(path, classname)
        contractwork = self.tron.trx.contract(abi=_abi, bytecode=_bytecode)
        contract = contractwork.constructor()
        tx_data = contract.transact(
            fee_limit=10 ** 9,
            call_value=0,
            parameters=params,
            consume_user_resource_percent=1)
        print(&#34;======== TX Result ✅&#34;)
        sign = self.tron.trx.sign(tx_data)
        print(&#34;======== Signing {} ✅&#34;.format(classname))
        result = self.tron.trx.broadcast(sign)
        path = &#34;{}/{}.json&#34;.format(self.ACTION_FOLDER, classname)
        print(&#34;======== Broadcast Result ✅ -&gt; {}&#34;.format(path))
        sol_wrap.StoreTxResult(result, path)
        contract_address = self.tron.address.from_hex(result[&#34;transaction&#34;][&#34;contract_address&#34;])
        self._contract_dict[classname] = contract_address
        print(&#34;======== address saved to ✅ {} -&gt; {}&#34;.format(contract_address, classname))
        return contract_address


class WrapContract(object):
    &#34;&#34;&#34;docstring for WrapContract The contract for this BOBA TEA&#34;&#34;&#34;

    def __init__(self, _network):
        nn1 = Tron().setNetwork(_network)
        if nn1.is_connected():
            self.tron_client = nn1
        else:
            print(
                &#34;client v1 is not connected. please check the internet connection or the service is down! network: {}&#34;.format(
                    _network))

        self._tron_module = nn1.trx
        self._contract = None

    def getClientTron(self) -&gt; &#34;Tron&#34;:
        return self.tron_client

    def setMasterKey(self, pub: str, pri: str) -&gt; &#34;WrapContract&#34;:
        self.tron_client.private_key = pri
        self.tron_client.default_address = pub
        return self

    def initContract(self, contract_metadata) -&gt; &#34;WrapContract&#34;:
        &#34;&#34;&#34;
        Load and initiate contract interface by using the deployed contract json metadata
        try:
        except FileNotFoundError as e:
            print(&#34;Could not load the file &#34;, e)
        except Exception as e:
            print(&#34;Problems from loading items from the file: &#34;, e)
        &#34;&#34;&#34;
        contractDict = json.load(codecs.open(contract_metadata, &#39;r&#39;, &#39;utf-8-sig&#39;))
        trn = contractDict[&#34;transaction&#34;]
        hex_address = trn[&#34;contract_address&#34;]
        self.transction_detail = contractDict
        self.trc_address = self.tron_client.address.from_hex(hex_address)
        print(&#34;@contract address {} from hex {}&#34;.format(self.trc_address, hex_address))
        # self.init_internal_contract()
        self.implcontract()
        return self

    def getTxID(self):
        return self.transction_detail[&#34;txid&#34;]

    def implcontract(self):
        pass</code></pre>
</details>
</section>
<section>
</section>
<section>
</section>
<section>
</section>
<section>
<h2 class="section-title" id="header-classes">Classes</h2>
<dl>
<dt id="tronpytool.compile.basetest.CoreDeploy"><code class="flex name class">
<span>class <span class="ident">CoreDeploy</span></span>
<span>(</span><span>tron: <a title="tronpytool.main.Tron" href="../main.html#tronpytool.main.Tron">Tron</a>)</span>
</code></dt>
<dd>
<div class="desc"><p>DEFI Contract deployment
with the right strategies</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class CoreDeploy:
    &#34;&#34;&#34;DEFI Contract deployment
    with the right strategies
    &#34;&#34;&#34;
    _contract_dict: dict
    FILE_CONTRACT = &#34;backedup&#34;
    ACTION_FOLDER = &#34;deploy_results&#34;
    COLLECTION_CONTRACTS = &#34;deployments&#34;

    def __init__(self, tron: Tron):
        self.tron = tron
        self._contract_dict = dict()

    @property
    def backupname(self) -&gt; str:
        &#34;&#34;&#34;preview the file name&#34;&#34;&#34;
        return self.FILE_CONTRACT

    @backupname.setter
    def backupname(self, filename: str) -&gt; None:
        &#34;&#34;&#34;the file name does not require extension name&#34;&#34;&#34;
        self.FILE_CONTRACT = filename

    @property
    def deployment_location(self) -&gt; str:
        return self.COLLECTION_CONTRACTS

    @deployment_location.setter
    def deployment_location(self, path: str) -&gt; None:
        self.COLLECTION_CONTRACTS = path

    def getAddr(self, keyname: str) -&gt; str:
        &#34;&#34;&#34;example: TT67rPNwgmpeimvHUMVzFfKsjL9GZ1wGw8&#34;&#34;&#34;
        return self._contract_dict.get(keyname)

    def getAddr0x(self, keyname: str) -&gt; str:
        &#34;&#34;&#34;example: 0xBBC8C05F1B09839E72DB044A6AA57E2A5D414A10&#34;&#34;&#34;
        return self.tron.address.to_hex_0x(self._contract_dict.get(keyname))

    def getAddr0x41(self, keyname: str) -&gt; str:
        &#34;&#34;&#34;example: 0x41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10&#34;&#34;&#34;
        return self.tron.address.to_hex_0x_41(self._contract_dict.get(keyname))

    def getAddrHex(self, keyname: str) -&gt; str:
        &#34;&#34;&#34;example: 41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10&#34;&#34;&#34;
        return self.tron.address.to_hex(self._contract_dict.get(keyname))

    def getAllAddress(self) -&gt; dict:
        return self._contract_dict

    def preview_all_addresses(self) -&gt; None:
        print(self._contract_dict)

    def deployedAddrsFilePath(self) -&gt; str:
        return os.path.join(self.sol_cont.workspace, self.ACTION_FOLDER,
                            &#34;{}.json&#34;.format(self.COLLECTION_CONTRACTS))

    def is_deployment(self) -&gt; bool:
        return self.is_deploy

    def connect_deploy_core(self, workspace: str, rebuild=False, deploy=False) -&gt; None:
        if rebuild:
            sol_contr = SolcWrap(workspace).BuildRemote()
        else:
            sol_contr = SolcWrap(workspace)

        self.is_deploy = deploy
        self.sol_cont = sol_contr
        if not deploy:
            &#34;&#34;&#34;try to load up the file from the existing path&#34;&#34;&#34;
            try:
                self._contract_dict = json.load(codecs.open(self.deployedAddrsFilePath(), &#39;r&#39;, &#39;utf-8-sig&#39;))
                print(&#34;==== 🛄 data is prepared and it is ready now.. &#34;)
                self.preview_all_addresses()
            except ValueError:
                pass
            except TypeError as e:
                print(e)

    def complete_deployment(self) -&gt; None:
        &#34;&#34;&#34;store up the deployed contrcat addresses to the local file storage&#34;&#34;&#34;
        self.sol_cont.StoreTxResult(self._contract_dict, self.deployedAddrsFilePath())

    def deploy(self, sol_wrap: SolcWrap, classname: str, params: list = []) -&gt; str:
        &#34;&#34;&#34;This is using the faster way to deploy files by using the specific abi and bin files&#34;&#34;&#34;
        _abi, _bytecode = sol_wrap.GetCodeClass(classname)
        contractwork = self.tron.trx.contract(abi=_abi, bytecode=_bytecode)
        contract = contractwork.constructor()
        tx_data = contract.transact(
            fee_limit=10 ** 9,
            call_value=0,
            parameters=params,
            consume_user_resource_percent=1)
        print(&#34;======== TX Result ✅&#34;)
        sign = self.tron.trx.sign(tx_data)
        print(&#34;======== Signing {} ✅&#34;.format(classname))
        result = self.tron.trx.broadcast(sign)
        path = &#34;{}/{}.json&#34;.format(self.ACTION_FOLDER, classname)
        print(&#34;======== Broadcast Result ✅ -&gt; {}&#34;.format(path))
        sol_wrap.StoreTxResult(result, path)
        contract_address = self.tron.address.from_hex(result[&#34;transaction&#34;][&#34;contract_address&#34;])
        self._contract_dict[classname] = contract_address
        print(&#34;======== address saved to ✅ {} -&gt; {}&#34;.format(contract_address, classname))
        return contract_address

    def classic_deploy(self, sol_wrap: SolcWrap, path: str, classname: str, params: list = []) -&gt; str:
        self.sol_cont.WrapModel()
        _abi, _bytecode = sol_wrap.GetCode(path, classname)
        contractwork = self.tron.trx.contract(abi=_abi, bytecode=_bytecode)
        contract = contractwork.constructor()
        tx_data = contract.transact(
            fee_limit=10 ** 9,
            call_value=0,
            parameters=params,
            consume_user_resource_percent=1)
        print(&#34;======== TX Result ✅&#34;)
        sign = self.tron.trx.sign(tx_data)
        print(&#34;======== Signing {} ✅&#34;.format(classname))
        result = self.tron.trx.broadcast(sign)
        path = &#34;{}/{}.json&#34;.format(self.ACTION_FOLDER, classname)
        print(&#34;======== Broadcast Result ✅ -&gt; {}&#34;.format(path))
        sol_wrap.StoreTxResult(result, path)
        contract_address = self.tron.address.from_hex(result[&#34;transaction&#34;][&#34;contract_address&#34;])
        self._contract_dict[classname] = contract_address
        print(&#34;======== address saved to ✅ {} -&gt; {}&#34;.format(contract_address, classname))
        return contract_address</code></pre>
</details>
<h3>Class variables</h3>
<dl>
<dt id="tronpytool.compile.basetest.CoreDeploy.ACTION_FOLDER"><code class="name">var <span class="ident">ACTION_FOLDER</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.COLLECTION_CONTRACTS"><code class="name">var <span class="ident">COLLECTION_CONTRACTS</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.FILE_CONTRACT"><code class="name">var <span class="ident">FILE_CONTRACT</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
<h3>Instance variables</h3>
<dl>
<dt id="tronpytool.compile.basetest.CoreDeploy.backupname"><code class="name">var <span class="ident">backupname</span> : str</code></dt>
<dd>
<div class="desc"><p>preview the file name</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">@property
def backupname(self) -&gt; str:
    &#34;&#34;&#34;preview the file name&#34;&#34;&#34;
    return self.FILE_CONTRACT</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.deployment_location"><code class="name">var <span class="ident">deployment_location</span> : str</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">@property
def deployment_location(self) -&gt; str:
    return self.COLLECTION_CONTRACTS</code></pre>
</details>
</dd>
</dl>
<h3>Methods</h3>
<dl>
<dt id="tronpytool.compile.basetest.CoreDeploy.classic_deploy"><code class="name flex">
<span>def <span class="ident">classic_deploy</span></span>(<span>self, sol_wrap: <a title="tronpytool.compile.basetest.SolcWrap" href="#tronpytool.compile.basetest.SolcWrap">SolcWrap</a>, path: str, classname: str, params: list = []) ‑> str</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def classic_deploy(self, sol_wrap: SolcWrap, path: str, classname: str, params: list = []) -&gt; str:
    self.sol_cont.WrapModel()
    _abi, _bytecode = sol_wrap.GetCode(path, classname)
    contractwork = self.tron.trx.contract(abi=_abi, bytecode=_bytecode)
    contract = contractwork.constructor()
    tx_data = contract.transact(
        fee_limit=10 ** 9,
        call_value=0,
        parameters=params,
        consume_user_resource_percent=1)
    print(&#34;======== TX Result ✅&#34;)
    sign = self.tron.trx.sign(tx_data)
    print(&#34;======== Signing {} ✅&#34;.format(classname))
    result = self.tron.trx.broadcast(sign)
    path = &#34;{}/{}.json&#34;.format(self.ACTION_FOLDER, classname)
    print(&#34;======== Broadcast Result ✅ -&gt; {}&#34;.format(path))
    sol_wrap.StoreTxResult(result, path)
    contract_address = self.tron.address.from_hex(result[&#34;transaction&#34;][&#34;contract_address&#34;])
    self._contract_dict[classname] = contract_address
    print(&#34;======== address saved to ✅ {} -&gt; {}&#34;.format(contract_address, classname))
    return contract_address</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.complete_deployment"><code class="name flex">
<span>def <span class="ident">complete_deployment</span></span>(<span>self) ‑> NoneType</span>
</code></dt>
<dd>
<div class="desc"><p>store up the deployed contrcat addresses to the local file storage</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def complete_deployment(self) -&gt; None:
    &#34;&#34;&#34;store up the deployed contrcat addresses to the local file storage&#34;&#34;&#34;
    self.sol_cont.StoreTxResult(self._contract_dict, self.deployedAddrsFilePath())</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.connect_deploy_core"><code class="name flex">
<span>def <span class="ident">connect_deploy_core</span></span>(<span>self, workspace: str, rebuild=False, deploy=False) ‑> NoneType</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def connect_deploy_core(self, workspace: str, rebuild=False, deploy=False) -&gt; None:
    if rebuild:
        sol_contr = SolcWrap(workspace).BuildRemote()
    else:
        sol_contr = SolcWrap(workspace)

    self.is_deploy = deploy
    self.sol_cont = sol_contr
    if not deploy:
        &#34;&#34;&#34;try to load up the file from the existing path&#34;&#34;&#34;
        try:
            self._contract_dict = json.load(codecs.open(self.deployedAddrsFilePath(), &#39;r&#39;, &#39;utf-8-sig&#39;))
            print(&#34;==== 🛄 data is prepared and it is ready now.. &#34;)
            self.preview_all_addresses()
        except ValueError:
            pass
        except TypeError as e:
            print(e)</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.deploy"><code class="name flex">
<span>def <span class="ident">deploy</span></span>(<span>self, sol_wrap: <a title="tronpytool.compile.basetest.SolcWrap" href="#tronpytool.compile.basetest.SolcWrap">SolcWrap</a>, classname: str, params: list = []) ‑> str</span>
</code></dt>
<dd>
<div class="desc"><p>This is using the faster way to deploy files by using the specific abi and bin files</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def deploy(self, sol_wrap: SolcWrap, classname: str, params: list = []) -&gt; str:
    &#34;&#34;&#34;This is using the faster way to deploy files by using the specific abi and bin files&#34;&#34;&#34;
    _abi, _bytecode = sol_wrap.GetCodeClass(classname)
    contractwork = self.tron.trx.contract(abi=_abi, bytecode=_bytecode)
    contract = contractwork.constructor()
    tx_data = contract.transact(
        fee_limit=10 ** 9,
        call_value=0,
        parameters=params,
        consume_user_resource_percent=1)
    print(&#34;======== TX Result ✅&#34;)
    sign = self.tron.trx.sign(tx_data)
    print(&#34;======== Signing {} ✅&#34;.format(classname))
    result = self.tron.trx.broadcast(sign)
    path = &#34;{}/{}.json&#34;.format(self.ACTION_FOLDER, classname)
    print(&#34;======== Broadcast Result ✅ -&gt; {}&#34;.format(path))
    sol_wrap.StoreTxResult(result, path)
    contract_address = self.tron.address.from_hex(result[&#34;transaction&#34;][&#34;contract_address&#34;])
    self._contract_dict[classname] = contract_address
    print(&#34;======== address saved to ✅ {} -&gt; {}&#34;.format(contract_address, classname))
    return contract_address</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.deployedAddrsFilePath"><code class="name flex">
<span>def <span class="ident">deployedAddrsFilePath</span></span>(<span>self) ‑> str</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def deployedAddrsFilePath(self) -&gt; str:
    return os.path.join(self.sol_cont.workspace, self.ACTION_FOLDER,
                        &#34;{}.json&#34;.format(self.COLLECTION_CONTRACTS))</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.getAddr"><code class="name flex">
<span>def <span class="ident">getAddr</span></span>(<span>self, keyname: str) ‑> str</span>
</code></dt>
<dd>
<div class="desc"><p>example: TT67rPNwgmpeimvHUMVzFfKsjL9GZ1wGw8</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getAddr(self, keyname: str) -&gt; str:
    &#34;&#34;&#34;example: TT67rPNwgmpeimvHUMVzFfKsjL9GZ1wGw8&#34;&#34;&#34;
    return self._contract_dict.get(keyname)</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.getAddr0x"><code class="name flex">
<span>def <span class="ident">getAddr0x</span></span>(<span>self, keyname: str) ‑> str</span>
</code></dt>
<dd>
<div class="desc"><p>example: 0xBBC8C05F1B09839E72DB044A6AA57E2A5D414A10</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getAddr0x(self, keyname: str) -&gt; str:
    &#34;&#34;&#34;example: 0xBBC8C05F1B09839E72DB044A6AA57E2A5D414A10&#34;&#34;&#34;
    return self.tron.address.to_hex_0x(self._contract_dict.get(keyname))</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.getAddr0x41"><code class="name flex">
<span>def <span class="ident">getAddr0x41</span></span>(<span>self, keyname: str) ‑> str</span>
</code></dt>
<dd>
<div class="desc"><p>example: 0x41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getAddr0x41(self, keyname: str) -&gt; str:
    &#34;&#34;&#34;example: 0x41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10&#34;&#34;&#34;
    return self.tron.address.to_hex_0x_41(self._contract_dict.get(keyname))</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.getAddrHex"><code class="name flex">
<span>def <span class="ident">getAddrHex</span></span>(<span>self, keyname: str) ‑> str</span>
</code></dt>
<dd>
<div class="desc"><p>example: 41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getAddrHex(self, keyname: str) -&gt; str:
    &#34;&#34;&#34;example: 41BBC8C05F1B09839E72DB044A6AA57E2A5D414A10&#34;&#34;&#34;
    return self.tron.address.to_hex(self._contract_dict.get(keyname))</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.getAllAddress"><code class="name flex">
<span>def <span class="ident">getAllAddress</span></span>(<span>self) ‑> dict</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getAllAddress(self) -&gt; dict:
    return self._contract_dict</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.is_deployment"><code class="name flex">
<span>def <span class="ident">is_deployment</span></span>(<span>self) ‑> bool</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def is_deployment(self) -&gt; bool:
    return self.is_deploy</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.CoreDeploy.preview_all_addresses"><code class="name flex">
<span>def <span class="ident">preview_all_addresses</span></span>(<span>self) ‑> NoneType</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def preview_all_addresses(self) -&gt; None:
    print(self._contract_dict)</code></pre>
</details>
</dd>
</dl>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap"><code class="flex name class">
<span>class <span class="ident">SolcWrap</span></span>
<span>(</span><span>workspace)</span>
</code></dt>
<dd>
<div class="desc"><p>docstring for SolcWrap</p>
<p>param workspace: this is the local path for the file set</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class SolcWrap(object):
    &#34;&#34;&#34;docstring for SolcWrap&#34;&#34;&#34;
    OUTPUT_BUILD = &#34;build&#34;
    WORKSPACE_PATH = &#34;&#34;
    solfolder = &#34;&#34;
    file_name = &#34;xxx.sol&#34;
    prefixname = &#34;&#34;
    statement = &#39;End : {}, IO File {}&#39;

    def __init__(self, workspace):
        &#34;&#34;&#34;param workspace: this is the local path for the file set&#34;&#34;&#34;
        self.WORKSPACE_PATH = workspace
        super(SolcWrap, self).__init__()

    def SetOutput(self, path):
        self.OUTPUTBUILD = path
        return self

    def SetSolPath(self, path):
        self.solfolder = path
        return self

    def BuildRemote(self):
        &#34;&#34;&#34;This is the remote command to execute the solc_remote bash file
        using remote compile method to compile the sol files
        all works will be done with the remote server or using the docker&#34;&#34;&#34;
        list_files = subprocess.run([&#34;{}/solc_remote&#34;.format(self.WORKSPACE_PATH)])
        print(&#34;The exit code was: %d&#34; % list_files.returncode)
        return self

    def WrapModel(self):
        &#34;&#34;&#34;setup initialize the file for combined.json&#34;&#34;&#34;
        pathc = os.path.join(self.WORKSPACE_PATH, self.OUTPUT_BUILD, &#34;combined.json&#34;)
        try:
            pathcli = codecs.open(pathc, &#39;r&#39;, &#39;utf-8-sig&#39;)
            self.combined_data = json.load(pathcli)
        except Exception as e:
            print(&#34;Problems from loading items from the file: &#34;, e)
        return self

    def GetCodeClass(self, classname) -&gt; [any, any]:
        p1bin = os.path.join(self.WORKSPACE_PATH, self.OUTPUT_BUILD, &#34;{}.bin&#34;.format(classname))
        p2abi = os.path.join(self.WORKSPACE_PATH, self.OUTPUT_BUILD, &#34;{}.abi&#34;.format(classname))
        bin = codecs.open(p1bin, &#39;r&#39;, &#39;utf-8-sig&#39;).read()
        abi = json.load(codecs.open(p2abi, &#39;r&#39;, &#39;utf-8-sig&#39;))
        return abi, bin

    def byClassName(self, path, classname):
        return &#34;{prefix}:{name}&#34;.format(prefix=path, name=classname)

    def GetCodeTag(self, fullname):
        return self.combined_data[&#34;contracts&#34;][fullname][&#34;abi&#34;], self.combined_data[&#34;contracts&#34;][fullname][&#34;bin&#34;]

    def GetCode(self, path, classname) -&gt; [str, str]:
        abi = self.combined_data[&#34;contracts&#34;][self.byClassName(path, classname)][&#34;abi&#34;]
        bin = self.combined_data[&#34;contracts&#34;][self.byClassName(path, classname)][&#34;bin&#34;]
        return abi, bin

    def writeFile(self, content, filename):
        fo = open(filename, &#34;w&#34;)
        fo.write(content)
        fo.close()
        print(self.statement.format(time.ctime(), filename))

    @property
    def workspace(self):
        return self.WORKSPACE_PATH

    def StoreTxResult(self, tx_result_data, filepath):
        self.writeFile(json.dumps(tx_result_data, ensure_ascii=False), filepath)</code></pre>
</details>
<h3>Class variables</h3>
<dl>
<dt id="tronpytool.compile.basetest.SolcWrap.OUTPUT_BUILD"><code class="name">var <span class="ident">OUTPUT_BUILD</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.WORKSPACE_PATH"><code class="name">var <span class="ident">WORKSPACE_PATH</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.file_name"><code class="name">var <span class="ident">file_name</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.prefixname"><code class="name">var <span class="ident">prefixname</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.solfolder"><code class="name">var <span class="ident">solfolder</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.statement"><code class="name">var <span class="ident">statement</span></code></dt>
<dd>
<div class="desc"></div>
</dd>
</dl>
<h3>Instance variables</h3>
<dl>
<dt id="tronpytool.compile.basetest.SolcWrap.workspace"><code class="name">var <span class="ident">workspace</span></code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">@property
def workspace(self):
    return self.WORKSPACE_PATH</code></pre>
</details>
</dd>
</dl>
<h3>Methods</h3>
<dl>
<dt id="tronpytool.compile.basetest.SolcWrap.BuildRemote"><code class="name flex">
<span>def <span class="ident">BuildRemote</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>This is the remote command to execute the solc_remote bash file
using remote compile method to compile the sol files
all works will be done with the remote server or using the docker</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def BuildRemote(self):
    &#34;&#34;&#34;This is the remote command to execute the solc_remote bash file
    using remote compile method to compile the sol files
    all works will be done with the remote server or using the docker&#34;&#34;&#34;
    list_files = subprocess.run([&#34;{}/solc_remote&#34;.format(self.WORKSPACE_PATH)])
    print(&#34;The exit code was: %d&#34; % list_files.returncode)
    return self</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.GetCode"><code class="name flex">
<span>def <span class="ident">GetCode</span></span>(<span>self, path, classname) ‑> [<class 'str'>, <class 'str'>]</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def GetCode(self, path, classname) -&gt; [str, str]:
    abi = self.combined_data[&#34;contracts&#34;][self.byClassName(path, classname)][&#34;abi&#34;]
    bin = self.combined_data[&#34;contracts&#34;][self.byClassName(path, classname)][&#34;bin&#34;]
    return abi, bin</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.GetCodeClass"><code class="name flex">
<span>def <span class="ident">GetCodeClass</span></span>(<span>self, classname) ‑> [<built-in function any>, <built-in function any>]</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def GetCodeClass(self, classname) -&gt; [any, any]:
    p1bin = os.path.join(self.WORKSPACE_PATH, self.OUTPUT_BUILD, &#34;{}.bin&#34;.format(classname))
    p2abi = os.path.join(self.WORKSPACE_PATH, self.OUTPUT_BUILD, &#34;{}.abi&#34;.format(classname))
    bin = codecs.open(p1bin, &#39;r&#39;, &#39;utf-8-sig&#39;).read()
    abi = json.load(codecs.open(p2abi, &#39;r&#39;, &#39;utf-8-sig&#39;))
    return abi, bin</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.GetCodeTag"><code class="name flex">
<span>def <span class="ident">GetCodeTag</span></span>(<span>self, fullname)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def GetCodeTag(self, fullname):
    return self.combined_data[&#34;contracts&#34;][fullname][&#34;abi&#34;], self.combined_data[&#34;contracts&#34;][fullname][&#34;bin&#34;]</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.SetOutput"><code class="name flex">
<span>def <span class="ident">SetOutput</span></span>(<span>self, path)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def SetOutput(self, path):
    self.OUTPUTBUILD = path
    return self</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.SetSolPath"><code class="name flex">
<span>def <span class="ident">SetSolPath</span></span>(<span>self, path)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def SetSolPath(self, path):
    self.solfolder = path
    return self</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.StoreTxResult"><code class="name flex">
<span>def <span class="ident">StoreTxResult</span></span>(<span>self, tx_result_data, filepath)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def StoreTxResult(self, tx_result_data, filepath):
    self.writeFile(json.dumps(tx_result_data, ensure_ascii=False), filepath)</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.WrapModel"><code class="name flex">
<span>def <span class="ident">WrapModel</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"><p>setup initialize the file for combined.json</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def WrapModel(self):
    &#34;&#34;&#34;setup initialize the file for combined.json&#34;&#34;&#34;
    pathc = os.path.join(self.WORKSPACE_PATH, self.OUTPUT_BUILD, &#34;combined.json&#34;)
    try:
        pathcli = codecs.open(pathc, &#39;r&#39;, &#39;utf-8-sig&#39;)
        self.combined_data = json.load(pathcli)
    except Exception as e:
        print(&#34;Problems from loading items from the file: &#34;, e)
    return self</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.byClassName"><code class="name flex">
<span>def <span class="ident">byClassName</span></span>(<span>self, path, classname)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def byClassName(self, path, classname):
    return &#34;{prefix}:{name}&#34;.format(prefix=path, name=classname)</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.SolcWrap.writeFile"><code class="name flex">
<span>def <span class="ident">writeFile</span></span>(<span>self, content, filename)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def writeFile(self, content, filename):
    fo = open(filename, &#34;w&#34;)
    fo.write(content)
    fo.close()
    print(self.statement.format(time.ctime(), filename))</code></pre>
</details>
</dd>
</dl>
</dd>
<dt id="tronpytool.compile.basetest.WrapContract"><code class="flex name class">
<span>class <span class="ident">WrapContract</span></span>
<span>(</span><span>_network)</span>
</code></dt>
<dd>
<div class="desc"><p>docstring for WrapContract The contract for this BOBA TEA</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">class WrapContract(object):
    &#34;&#34;&#34;docstring for WrapContract The contract for this BOBA TEA&#34;&#34;&#34;

    def __init__(self, _network):
        nn1 = Tron().setNetwork(_network)
        if nn1.is_connected():
            self.tron_client = nn1
        else:
            print(
                &#34;client v1 is not connected. please check the internet connection or the service is down! network: {}&#34;.format(
                    _network))

        self._tron_module = nn1.trx
        self._contract = None

    def getClientTron(self) -&gt; &#34;Tron&#34;:
        return self.tron_client

    def setMasterKey(self, pub: str, pri: str) -&gt; &#34;WrapContract&#34;:
        self.tron_client.private_key = pri
        self.tron_client.default_address = pub
        return self

    def initContract(self, contract_metadata) -&gt; &#34;WrapContract&#34;:
        &#34;&#34;&#34;
        Load and initiate contract interface by using the deployed contract json metadata
        try:
        except FileNotFoundError as e:
            print(&#34;Could not load the file &#34;, e)
        except Exception as e:
            print(&#34;Problems from loading items from the file: &#34;, e)
        &#34;&#34;&#34;
        contractDict = json.load(codecs.open(contract_metadata, &#39;r&#39;, &#39;utf-8-sig&#39;))
        trn = contractDict[&#34;transaction&#34;]
        hex_address = trn[&#34;contract_address&#34;]
        self.transction_detail = contractDict
        self.trc_address = self.tron_client.address.from_hex(hex_address)
        print(&#34;@contract address {} from hex {}&#34;.format(self.trc_address, hex_address))
        # self.init_internal_contract()
        self.implcontract()
        return self

    def getTxID(self):
        return self.transction_detail[&#34;txid&#34;]

    def implcontract(self):
        pass</code></pre>
</details>
<h3>Methods</h3>
<dl>
<dt id="tronpytool.compile.basetest.WrapContract.getClientTron"><code class="name flex">
<span>def <span class="ident">getClientTron</span></span>(<span>self) ‑> <a title="tronpytool.main.Tron" href="../main.html#tronpytool.main.Tron">Tron</a></span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getClientTron(self) -&gt; &#34;Tron&#34;:
    return self.tron_client</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.WrapContract.getTxID"><code class="name flex">
<span>def <span class="ident">getTxID</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def getTxID(self):
    return self.transction_detail[&#34;txid&#34;]</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.WrapContract.implcontract"><code class="name flex">
<span>def <span class="ident">implcontract</span></span>(<span>self)</span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def implcontract(self):
    pass</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.WrapContract.initContract"><code class="name flex">
<span>def <span class="ident">initContract</span></span>(<span>self, contract_metadata) ‑> <a title="tronpytool.compile.basetest.WrapContract" href="#tronpytool.compile.basetest.WrapContract">WrapContract</a></span>
</code></dt>
<dd>
<div class="desc"><p>Load and initiate contract interface by using the deployed contract json metadata
try:
except FileNotFoundError as e:
print("Could not load the file ", e)
except Exception as e:
print("Problems from loading items from the file: ", e)</p></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def initContract(self, contract_metadata) -&gt; &#34;WrapContract&#34;:
    &#34;&#34;&#34;
    Load and initiate contract interface by using the deployed contract json metadata
    try:
    except FileNotFoundError as e:
        print(&#34;Could not load the file &#34;, e)
    except Exception as e:
        print(&#34;Problems from loading items from the file: &#34;, e)
    &#34;&#34;&#34;
    contractDict = json.load(codecs.open(contract_metadata, &#39;r&#39;, &#39;utf-8-sig&#39;))
    trn = contractDict[&#34;transaction&#34;]
    hex_address = trn[&#34;contract_address&#34;]
    self.transction_detail = contractDict
    self.trc_address = self.tron_client.address.from_hex(hex_address)
    print(&#34;@contract address {} from hex {}&#34;.format(self.trc_address, hex_address))
    # self.init_internal_contract()
    self.implcontract()
    return self</code></pre>
</details>
</dd>
<dt id="tronpytool.compile.basetest.WrapContract.setMasterKey"><code class="name flex">
<span>def <span class="ident">setMasterKey</span></span>(<span>self, pub: str, pri: str) ‑> <a title="tronpytool.compile.basetest.WrapContract" href="#tronpytool.compile.basetest.WrapContract">WrapContract</a></span>
</code></dt>
<dd>
<div class="desc"></div>
<details class="source">
<summary>
<span>Expand source code</span>
</summary>
<pre><code class="python">def setMasterKey(self, pub: str, pri: str) -&gt; &#34;WrapContract&#34;:
    self.tron_client.private_key = pri
    self.tron_client.default_address = pub
    return self</code></pre>
</details>
</dd>
</dl>
</dd>
</dl>
</section>
</article>
<nav id="sidebar">
<h1>Index</h1>
<div class="toc">
<ul></ul>
</div>
<ul id="index">
<li><h3>Super-module</h3>
<ul>
<li><code><a title="tronpytool.compile" href="index.html">tronpytool.compile</a></code></li>
</ul>
</li>
<li><h3><a href="#header-classes">Classes</a></h3>
<ul>
<li>
<h4><code><a title="tronpytool.compile.basetest.CoreDeploy" href="#tronpytool.compile.basetest.CoreDeploy">CoreDeploy</a></code></h4>
<ul class="">
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.ACTION_FOLDER" href="#tronpytool.compile.basetest.CoreDeploy.ACTION_FOLDER">ACTION_FOLDER</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.COLLECTION_CONTRACTS" href="#tronpytool.compile.basetest.CoreDeploy.COLLECTION_CONTRACTS">COLLECTION_CONTRACTS</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.FILE_CONTRACT" href="#tronpytool.compile.basetest.CoreDeploy.FILE_CONTRACT">FILE_CONTRACT</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.backupname" href="#tronpytool.compile.basetest.CoreDeploy.backupname">backupname</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.classic_deploy" href="#tronpytool.compile.basetest.CoreDeploy.classic_deploy">classic_deploy</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.complete_deployment" href="#tronpytool.compile.basetest.CoreDeploy.complete_deployment">complete_deployment</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.connect_deploy_core" href="#tronpytool.compile.basetest.CoreDeploy.connect_deploy_core">connect_deploy_core</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.deploy" href="#tronpytool.compile.basetest.CoreDeploy.deploy">deploy</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.deployedAddrsFilePath" href="#tronpytool.compile.basetest.CoreDeploy.deployedAddrsFilePath">deployedAddrsFilePath</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.deployment_location" href="#tronpytool.compile.basetest.CoreDeploy.deployment_location">deployment_location</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.getAddr" href="#tronpytool.compile.basetest.CoreDeploy.getAddr">getAddr</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.getAddr0x" href="#tronpytool.compile.basetest.CoreDeploy.getAddr0x">getAddr0x</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.getAddr0x41" href="#tronpytool.compile.basetest.CoreDeploy.getAddr0x41">getAddr0x41</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.getAddrHex" href="#tronpytool.compile.basetest.CoreDeploy.getAddrHex">getAddrHex</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.getAllAddress" href="#tronpytool.compile.basetest.CoreDeploy.getAllAddress">getAllAddress</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.is_deployment" href="#tronpytool.compile.basetest.CoreDeploy.is_deployment">is_deployment</a></code></li>
<li><code><a title="tronpytool.compile.basetest.CoreDeploy.preview_all_addresses" href="#tronpytool.compile.basetest.CoreDeploy.preview_all_addresses">preview_all_addresses</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="tronpytool.compile.basetest.SolcWrap" href="#tronpytool.compile.basetest.SolcWrap">SolcWrap</a></code></h4>
<ul class="two-column">
<li><code><a title="tronpytool.compile.basetest.SolcWrap.BuildRemote" href="#tronpytool.compile.basetest.SolcWrap.BuildRemote">BuildRemote</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.GetCode" href="#tronpytool.compile.basetest.SolcWrap.GetCode">GetCode</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.GetCodeClass" href="#tronpytool.compile.basetest.SolcWrap.GetCodeClass">GetCodeClass</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.GetCodeTag" href="#tronpytool.compile.basetest.SolcWrap.GetCodeTag">GetCodeTag</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.OUTPUT_BUILD" href="#tronpytool.compile.basetest.SolcWrap.OUTPUT_BUILD">OUTPUT_BUILD</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.SetOutput" href="#tronpytool.compile.basetest.SolcWrap.SetOutput">SetOutput</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.SetSolPath" href="#tronpytool.compile.basetest.SolcWrap.SetSolPath">SetSolPath</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.StoreTxResult" href="#tronpytool.compile.basetest.SolcWrap.StoreTxResult">StoreTxResult</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.WORKSPACE_PATH" href="#tronpytool.compile.basetest.SolcWrap.WORKSPACE_PATH">WORKSPACE_PATH</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.WrapModel" href="#tronpytool.compile.basetest.SolcWrap.WrapModel">WrapModel</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.byClassName" href="#tronpytool.compile.basetest.SolcWrap.byClassName">byClassName</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.file_name" href="#tronpytool.compile.basetest.SolcWrap.file_name">file_name</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.prefixname" href="#tronpytool.compile.basetest.SolcWrap.prefixname">prefixname</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.solfolder" href="#tronpytool.compile.basetest.SolcWrap.solfolder">solfolder</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.statement" href="#tronpytool.compile.basetest.SolcWrap.statement">statement</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.workspace" href="#tronpytool.compile.basetest.SolcWrap.workspace">workspace</a></code></li>
<li><code><a title="tronpytool.compile.basetest.SolcWrap.writeFile" href="#tronpytool.compile.basetest.SolcWrap.writeFile">writeFile</a></code></li>
</ul>
</li>
<li>
<h4><code><a title="tronpytool.compile.basetest.WrapContract" href="#tronpytool.compile.basetest.WrapContract">WrapContract</a></code></h4>
<ul class="">
<li><code><a title="tronpytool.compile.basetest.WrapContract.getClientTron" href="#tronpytool.compile.basetest.WrapContract.getClientTron">getClientTron</a></code></li>
<li><code><a title="tronpytool.compile.basetest.WrapContract.getTxID" href="#tronpytool.compile.basetest.WrapContract.getTxID">getTxID</a></code></li>
<li><code><a title="tronpytool.compile.basetest.WrapContract.implcontract" href="#tronpytool.compile.basetest.WrapContract.implcontract">implcontract</a></code></li>
<li><code><a title="tronpytool.compile.basetest.WrapContract.initContract" href="#tronpytool.compile.basetest.WrapContract.initContract">initContract</a></code></li>
<li><code><a title="tronpytool.compile.basetest.WrapContract.setMasterKey" href="#tronpytool.compile.basetest.WrapContract.setMasterKey">setMasterKey</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</nav>
</main>
<footer id="footer">
<p>Generated by <a href="https://pdoc3.github.io/pdoc"><cite>pdoc</cite> 0.9.1</a>.</p>
</footer>
</body>
</html>